package  
{
	import gs.TweenLite;
	import gs.easing.Quad;

	import com.bumpslide.tween.Fade;
	import com.bumpslide.ui.Applet;
	import com.bumpslide.ui.Box;

	import flash.events.MouseEvent;

	/**
	 * Quick test of the tween lite wrapper
	 * 
	 * @mxmlc -sp=../../classes -sp+=/Users/tkdave/resources/flash/lib/tweenlite -default-frame-rate 31
	 * 
	 * @author David Knape
	 */
	public class FadeTest extends Applet 
	{

		private var box:Box;
		
		static private var useTweenLite:Boolean = InitTweenLite();
		
		private static function InitTweenLite():Boolean
		{
			// make sure we have TweenLite and Quad imported
			TweenLite.defaultEase = Quad.easeOut;
			return true;
		}  

		
		override protected function addChildren():void
		{
			super.addChildren();
			
			box = new Box();
			box.buttonMode = true;
			box.alpha = 0;
			addChild( box );
			Fade.In( box, .5, 1, delegate( trace, 'all done' ) );
			
			box.addEventListener( MouseEvent.CLICK, handleClick);
		}
		
		
		private function handleClick(event:MouseEvent):void
		{
			Fade.Out(box, 3, 2, delegate(trace, 'done and done') );
		}
	}
}
